package lk.icta.core.dao;

import lk.icta.core.entity.Holder;
import lk.icta.user.entity.User;

import java.util.List;

/**
 * @author Duminda Dharmakeerthi
 */
public interface HolderDAO {

    /**
     * Add a holder
     *
     * @param holder Holder to be added
     * @param user   User requesting to add the holder
     */
    public void addHolder(Holder holder, User user);

    /**
     * Updating a holder
     *
     * @param holder Holder to be updated
     * @param user   User requesting to update the holder
     */
    public void updateHolder(Holder holder, User user);

    /**
     * Return the holder corresponding to the given id
     *
     * @param holderId Id of the holder
     * @param user     User requesting to find the holder
     * @return Holder related to the given id
     */
    public Holder getHolderById(long holderId, User user);

    /**
     * Return the holder corresponding to the given registration or NIC number
     *
     * @param registrationNo NIC or Registration number
     * @param user           User requesting to find the holder
     * @return Holder related to the given NIC or Registration number
     */
    public Holder getHolderByRegistrationNumber(String registrationNo, User user);

    /**
     * Return list of holders corresponding to the given name
     *
     * @param name Name of the holder
     * @param user User requesting to find the holders
     * @return List of holders related to the given name
     */
    public List<Holder> getHolderByName(String name, User user);

    /**
     * Return all holders
     *
     * @return List of all holders
     */
    public List<Holder> findAllHolders();
}
